package com.sphd.restaurantsystem.adapters;

import android.widget.ImageView;

import com.android.volley.toolbox.ImageLoader;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sphd.restaurantsystem.R;
import com.sphd.restaurantsystem.base.RestaurantsApplication;

import java.util.List;

/**
 * Created by Hu on 2016/11/17.
 */

public class GReyAdapter extends BaseQuickAdapter<String> {
    public GReyAdapter(int layoutResId, List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, String s) {
        ImageView imageView=baseViewHolder.getView(R.id.food_image);
        setImage(imageView,s);
    }
    public void setImage(ImageView image, String url) {
        ImageLoader imageLoader = RestaurantsApplication.getImageLoader();
        ImageLoader.ImageListener listener = ImageLoader.getImageListener(image,
                R.mipmap.moren, R.mipmap.moren);
        imageLoader.get(url, listener);
    }
}
